package com.io;

import java.io.*;

public class FlushDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("./4.txt");
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        String str = "hello,world";
        byte[] bytes = str.getBytes();
        bos.write(bytes);
        bos.flush();
        System.out.println("写出完毕");
        bos.close();
    }
}
